﻿Imports System.Data
Imports System.Data.Odbc

Public Class frmEliminarPago
    Dim VectorDepartamentoRexpetor(,) As String
    Dim capturaIdGasto As Integer
    Private Sub frmEliminarPago_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        datosEPCBCargaBlock()
        VectorDepartamentoRexpetor = listadoEPCargaDepartamento(1)
    End Sub

    Private Sub cbBlock_GotFocus(sender As Object, e As EventArgs) Handles cbBlock.GotFocus, cbPago.GotFocus, cbDepartamento.GotFocus
        lblMensaje.Visible = False
    End Sub

    Private Sub cbBlock_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbBlock.SelectedIndexChanged
        If IsNumeric(cbBlock.SelectedValue) Then
            cbDepartamento.Text = ""
            VectorDepartamentoRexpetor = listadoEPCargaDepartamento(cbBlock.SelectedValue)


        End If
    End Sub

    Private Sub cbDepartamento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbDepartamento.SelectedIndexChanged
        If IsNumeric(cbBlock.SelectedValue) Then
            CargarNID(VectorDepartamentoRexpetor(cbDepartamento.SelectedIndex, 0))
            cbPago.SelectedText = ""
        End If

    End Sub

    Private Sub btnEliminar_Click(sender As Object, e As EventArgs) Handles btnEliminar.Click
        If cbPago.SelectedIndex >= 0 Then
            EliminarPago(cbPago.SelectedValue)
        Else
            MessageBox.Show("No se pudo eliminar, debido a que NO existe un N° DE INGRESO", msjTituloModal, MessageBoxButtons.OK, MessageBoxIcon.Error)

        End If

    End Sub

End Class